using SqlSugar;
using IM.Easy.Core.Audit;

namespace IM.Easy.Entity.System
{
    /// <summary>
    /// API权限管理表
    /// </summary>
    [SugarTable("ApiPermissions")]
    public class ApiPermissions : ICreatedAt, IUpdatedAt
    {
        /// <summary>
        /// 主键ID，唯一标识
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
        public long Id { get; set; }

        /// <summary>
        /// 接口路径
        /// </summary>
        [SugarColumn(ColumnName = "Path")]
        public string Path { get; set; }

        /// <summary>
        /// 请求方法
        /// </summary>
        [SugarColumn(ColumnName = "HttpMethod")]
        public string HttpMethod { get; set; }

        /// <summary>
        /// 权限字符串
        /// </summary>
        [SugarColumn(ColumnName = "PermissionKey")]
        public string? PermissionKey { get; set; }

        /// <summary>
        /// 接口描述
        /// </summary>
        [SugarColumn(ColumnName = "Desc", ColumnDataType = "text")]
        public string? Desc { get; set; }

        /// <summary>
        /// 接口名称
        /// </summary>
        [SugarColumn(ColumnName = "Name")]
        public string? Name { get; set; }

        /// <summary>
        /// 启用状态
        /// </summary>
        [SugarColumn(ColumnName = "IsEnabled")]
        public bool IsEnabled { get; set; }

        /// <summary>
        /// 是否需要授权访问
        /// </summary>
        [SugarColumn(ColumnName = "AuthRequired")]
        public bool AuthRequired { get; set; }

        /// <summary>
        /// 是否跟踪操作记录
        /// </summary>
        [SugarColumn(ColumnName = "IsTrack")]
        public bool IsTrack { get; set; }


        [SugarColumn(ColumnName = "CreatedAt")]
        public DateTime? CreatedAt { get; set; }

        [SugarColumn(ColumnName = "UpdatedAt")]
        public DateTime? UpdatedAt { get; set; }
    }
}
